package com.wl.service.impl;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.wl.dao.DynamicDao;
import com.wl.pojo.Dynamic;
import com.wl.service.DynamicService;

@Service("dynamicService")
public class DynamicServiceImpl implements DynamicService {

	@Resource
	private DynamicDao dynamicDao;

	@Override // 查找所有
	public List<Dynamic> getDynamicAll() {
		return dynamicDao.selectDynamicAll();
	}

	@Override // 根据id查找
	public Dynamic getDynamicById(int dynId) {
		return dynamicDao.selectDynamicById(dynId);
	}

	@Override // 根据标题模糊查找
	public List<Dynamic> getDynamicByTitle(String dynTitle) {
		return dynamicDao.selectDynamicByTitle(dynTitle);
	}

	@Override // 添加
	public int addDynamic(Dynamic dyn) {
		return dynamicDao.insertDynamic(dyn);
	}

	@Override // 修改
	public int alterDynamic(Dynamic dyn) {
		return dynamicDao.updateDynamic(dyn);
	}

	@Override // 根据id删除
	public int removeDynamic(int dynId) {
		return dynamicDao.deleteDynamic(dynId);
	}

}
